home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok33.lha
/
Wirth
/
Kurven
/
Hilbert.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
2KB
|
75 lines
(* -------------------------------------------------------------------------
:Program. Hilbert
:Author. Kai Bolay
:Address. Hoffmannstraße 168, 7250 Leonberg
:Phone. 07152/22135
:History. v1.00 Initial
:Copyright. PD
:Language. Modula-2
:Translator. M2Amiga 3.2d
:Contents. Draws Hilbert...
------------------------------------------------------------------------- *)
MODULE Hilbert;
FROM Dos IMPORT Delay;
FROM LineDrawing IMPORT SetXY, Line, width, height;
VAR i, u, x0, y0 : INTEGER;
ciapra [0BFE001H] : SET OF (s0, s1, s2, s3, s4, s5, lmb); (* Mouse *)
PROCEDURE A (i : INTEGER); FORWARD;
PROCEDURE B (i : INTEGER); FORWARD;
PROCEDURE C (i : INTEGER); FORWARD;
PROCEDURE D (i : INTEGER); FORWARD;
PROCEDURE A (i : INTEGER);
BEGIN
IF i > 0 THEN
D (i-1); Line (4, u); A (i-1); Line (6, u);
A (i-1); Line (0, u); B (i-1);
END; (* IF *)
END A;
PROCEDURE B (i : INTEGER);
BEGIN
IF i > 0 THEN
C (i-1); Line (2, u); B (i-1); Line (0, u);
B (i-1); Line (6, u); A (i-1);
END; (* IF *)
END B;
PROCEDURE C (i : INTEGER);
BEGIN
IF i > 0 THEN
B (i-1); Line (0, u); C (i-1); Line (2, u);
C (i-1); Line (4, u); D (i-1);
END; (* IF *)
END C;
PROCEDURE D (i : INTEGER);
BEGIN
IF i > 0 THEN
A (i-1); Line (6, u); D (i-1); Line (4, u);
D (i-1); Line (2, u); C (i-1);
END; (* IF *)
END D;
BEGIN
x0 := width DIV 2; y0 := height DIV 2;
u := (height DIV 80) * 64;
FOR i := 1 TO 5 DO
u := u DIV 2;
x0 := x0 + (u DIV 2); y0 := y0 + (u DIV 2);
SetXY (x0, y0);
A (i);
WHILE lmb IN ciapra DO Delay (10); END;
END; (* FOR *)
END Hilbert.